import jdk.swing.interop.SwingInterOpUtils;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    //三国游戏
    //多变量转单变量：
    // 1 . 假定结果，假定某一个国家获胜
    // 2 . 对三国事件的结果做差值，然后对差值进行排序
    // 3 . 取和值 > 0 之前的事件

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int[] A = new int[n+1];
        for (int i = 1; i <= n; i++) {
            A[i] = scanner.nextInt();
        }

        int[] B = new int[n+1];
        for (int i = 1; i <= n; i++) {
            B[i] = scanner.nextInt();
        }

        int[] C = new int[n+1];
        for (int i = 1; i <= n; i++) {
            C[i] = scanner.nextInt();
        }

        int ansA = battle(A, B, C, n);
        int ansB = battle(B, A, C, n);
        int ansC = battle(C, A, B, n);

        System.out.println(Math.max(ansA, Math.max(ansB, ansC)));
        scanner.close();
    }

    public static int battle(int[] a, int[] b, int[] c, int n) {
        int[] battle = new int[n+1];
        for (int i = 1; i <= n; i++) {
            battle[i] = a[i] - b[i] - c[i];
        }
        Arrays.sort(battle, 1, n+1); // 对区间[1, n+1)排序

        long sum = 0;
        int ans = 0;
        for (int i = n; i >= 1; i--) {
            sum += battle[i];
            if (sum > 0) ans++;
        }
        return ans > 0 ? ans : -1;
    }


}
